package com.zp.business.controller.register;

import com.zp.business.entity.register.bo.RegisterFormBo;
import com.zp.business.service.register.ICurrentRegisterService;
import com.zp.common.core.controller.BaseController;
import com.zp.common.core.entity.R;
import com.zp.common.log.annotation.Log;
import com.zp.common.log.enums.BusinessType;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 门诊挂号保存控制器
 * 前端访问路由地址为:/finance/currentRegister
 *
 * @author zhang peng
 * @ date 2023-12-23
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/currentRegister")
public class CurrentRegisterController extends BaseController {

    private final ICurrentRegisterService currentRegisterService;
    /**
     * 新增门诊挂号
     */
    @Log(title = "门诊挂号", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public R<Void> add (@RequestBody RegisterFormBo bo) {
        return toAjax(currentRegisterService.add(bo) ? 1 : 0);
    }
}
